package com.ian.service.impl;

import com.ian.dao.PerLikeMapper;
import com.ian.pojo.PerLike;
import com.ian.service.PerLikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 收藏Service
 *
 * @Author IanZy
 * @Date 2020/6/20
 */
@Service
public class PerLikeServiceImpl implements PerLikeService {
    @Autowired
    PerLikeMapper perLikeMapper;

    @Transactional
    @Override
    public int insert(PerLike record) {
        return perLikeMapper.insert(record);
    }

    @Override
    public int deleteByPrimaryKey(Integer perLikeId) {
        return perLikeMapper.deleteByPrimaryKey(perLikeId);
    }

    @Override
    public PerLike selectByArticleId(Integer perArticleId) {
        return perLikeMapper.selectByArticleId(perArticleId);
    }

    @Override
    public List<PerLike> selectByUid(Integer perUserId) {
        return perLikeMapper.selectByUid(perUserId);
    }

    @Override
    public int deleteByArticleId(Integer perArticleId) {
        return perLikeMapper.deleteByArticleId(perArticleId);
    }

    @Override
    public PerLike selectByStallId(Integer perStallId) {
        return perLikeMapper.selectByStallId(perStallId);
    }

    @Override
    public int deleteByStallId(Integer perStallId) {
        return perLikeMapper.deleteByStallId(perStallId);
    }
}
